Optimal. Leaf size=58 \[ \frac {(a B+b C) x}{a^2+b^2}+\frac {(b B-a C) \log (a \cos (c+d x)+b \sin (c+d x))}{\left (a^2+b^2\right ) d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.079, Rules used = {3713, 3612,
3611} \begin {gather*} \frac {(b B-a C) \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )}+\frac {x (a B+b C)}{a^2+b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3611
Rule 3612
Rule 3713
Rubi steps
\begin {align*} \int \frac {\cot (c+d x) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx &=\int \frac {B+C \tan (c+d x)}{a+b \tan (c+d x)} \, dx\\ &=\frac {(a B+b C) x}{a^2+b^2}+\frac {(b B-a C) \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{a^2+b^2}\\ &=\frac {(a B+b C) x}{a^2+b^2}+\frac {(b B-a C) \log (a \cos (c+d x)+b \sin (c+d x))}{\left (a^2+b^2\right ) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.09, size = 67, normalized size = 1.16 \begin {gather*} \frac {-2 (a B+b C) \text {ArcTan}(\cot (c+d x))+(b B-a C) \left (2 \log (b+a \cot (c+d x))-\log \left (\csc ^2(c+d x)\right )\right )}{2 \left (a^2+b^2\right ) d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.37, size = 82, normalized size = 1.41
method | result | size |
derivativedivides | \(\frac {\frac {\left (B b -C a \right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{2}+b^{2}}+\frac {\frac {\left (-B b +C a \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (a B +C b \right ) \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}}{d}\) | \(82\) |
default | \(\frac {\frac {\left (B b -C a \right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{2}+b^{2}}+\frac {\frac {\left (-B b +C a \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (a B +C b \right ) \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}}{d}\) | \(82\) |
norman | \(\frac {\left (a B +C b \right ) x}{a^{2}+b^{2}}+\frac {\left (B b -C a \right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{d \left (a^{2}+b^{2}\right )}-\frac {\left (B b -C a \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d \left (a^{2}+b^{2}\right )}\) | \(85\) |
risch | \(-\frac {x B}{i b -a}+\frac {i x C}{i b -a}-\frac {2 i b B x}{a^{2}+b^{2}}+\frac {2 i C a x}{a^{2}+b^{2}}-\frac {2 i b B c}{d \left (a^{2}+b^{2}\right )}+\frac {2 i C a c}{d \left (a^{2}+b^{2}\right )}+\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right ) B}{d \left (a^{2}+b^{2}\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right ) C a}{d \left (a^{2}+b^{2}\right )}\) | \(186\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.52, size = 88, normalized size = 1.52 \begin {gather*} \frac {\frac {2 \, {\left (B a + C b\right )} {\left (d x + c\right )}}{a^{2} + b^{2}} - \frac {2 \, {\left (C a - B b\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{2} + b^{2}} + \frac {{\left (C a - B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.65, size = 76, normalized size = 1.31 \begin {gather*} \frac {2 \, {\left (B a + C b\right )} d x - {\left (C a - B b\right )} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, {\left (a^{2} + b^{2}\right )} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 1.41, size = 541, normalized size = 9.33 \begin {gather*} \begin {cases} \frac {\tilde {\infty } x \left (B \tan {\left (c \right )} + C \tan ^{2}{\left (c \right )}\right ) \cot {\left (c \right )}}{\tan {\left (c \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac {i B d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {B d x}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {i B}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {C d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} - \frac {i C d x}{2 b d \tan {\left (c + d x \right )} - 2 i b d} - \frac {C}{2 b d \tan {\left (c + d x \right )} - 2 i b d} & \text {for}\: a = - i b \\- \frac {i B d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {B d x}{2 b d \tan {\left (c + d x \right )} + 2 i b d} - \frac {i B}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {C d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {i C d x}{2 b d \tan {\left (c + d x \right )} + 2 i b d} - \frac {C}{2 b d \tan {\left (c + d x \right )} + 2 i b d} & \text {for}\: a = i b \\\frac {x \left (B \tan {\left (c \right )} + C \tan ^{2}{\left (c \right )}\right ) \cot {\left (c \right )}}{a + b \tan {\left (c \right )}} & \text {for}\: d = 0 \\\frac {B x + \frac {C \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d}}{a} & \text {for}\: b = 0 \\\frac {2 B a d x}{2 a^{2} d + 2 b^{2} d} + \frac {2 B b \log {\left (\frac {a}{b} + \tan {\left (c + d x \right )} \right )}}{2 a^{2} d + 2 b^{2} d} - \frac {B b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a^{2} d + 2 b^{2} d} - \frac {2 C a \log {\left (\frac {a}{b} + \tan {\left (c + d x \right )} \right )}}{2 a^{2} d + 2 b^{2} d} + \frac {C a \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a^{2} d + 2 b^{2} d} + \frac {2 C b d x}{2 a^{2} d + 2 b^{2} d} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.80, size = 94, normalized size = 1.62 \begin {gather*} \frac {\frac {2 \, {\left (B a + C b\right )} {\left (d x + c\right )}}{a^{2} + b^{2}} + \frac {{\left (C a - B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac {2 \, {\left (C a b - B b^{2}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{2} b + b^{3}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.12, size = 93, normalized size = 1.60 \begin {gather*} \frac {\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (B\,b-C\,a\right )}{d\,\left (a^2+b^2\right )}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B-C\,1{}\mathrm {i}\right )}{2\,d\,\left (b+a\,1{}\mathrm {i}\right )}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (-C+B\,1{}\mathrm {i}\right )}{2\,d\,\left (a+b\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________